//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================
#ifndef __HACKER_H__
#define __HACKER_H__

#include <driver.h>

#define DRIVER_KEYBOARD  0
#define DRIVER_MOUSE     1
#define DRIVER_VIDEO     2
#define DRIVER_NOTIFIERCENTER 3
#define DRIVER_IME 4

class CHacker: public CDeviceDriver
{
public:
    CARAPI Read(
        /* [in] */  Int64 offset,
        /* [in] */  Int32 numberOfBytesToRead,
        /* [out] */ MemoryBuf * pData,
        /* [out] */ IEvent * * ppCompletionEvent);

    CARAPI Write(
        /* [in] */  Int64 offset,
        /* [in] */ const  MemoryBuf & ebbData,
        /* [out] */ Int32 * puNumberOfBytesWritten,
        /* [out] */ IEvent * * ppCompletionEvent);

    CARAPI Control(
        /* [in] */  Handle32 nControlCode,
        /* [in] */ const  MemoryBuf & ebbInData,
        /* [out] */ MemoryBuf * pOutData,
        /* [out] */ IEvent * * ppCompletionEvent);

    void Dispose();

private:
    ECode GetSpecialDriver(
        /* [in] */ Int32 driverType,
        /* [in] */ Int32 environmentId,
        /* [out] */ IDeviceDriver ** ppDriver);

//private:
//    CHacker(): m_pKeyboard(NULL),
//               m_pMouse(NULL),
//               m_pVideo(NULL) {}
//private:
//    IDeviceDriver * m_pKeyboard;
//    IDeviceDriver * m_pMouse;
//    IDeviceDriver * m_pVideo;
};

EXTERN ECode GetHackHelper(IDeviceDriver ** ppHacker);

#endif //__HACKER_H__
